package com.wisdom.smartbook.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.wisdom.smartbook.activity.SplashActivity;
import com.wisdom.smartbook.utils.KLog;


public class BootBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {// 设备一开机就自动启动应用
        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
            Intent it = new Intent(context, SplashActivity.class);
//            it.setAction("android.intent.action.MAIN");
//            it.addCategory("android.intent.category.LAUNCHER");
            it.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(it);
            KLog.d("Boot 开机自动启动");
        } else {
            KLog.d("Boot 非开机自动启动");
        }
    }


}
